home *** CD-ROM | disk | FTP | other *** search
-
- {
- if(true)
- {
- CPosition = §§newclass(CPosition,Point);
- }
- }
-
- package Local.Game.World
- {
- import flash.display.*;
- import flash.geom.*;
-
- public class CPosition extends Point
- {
-
-
- public function CPosition(param1:Number = 0, param2:Number = 0)
- {
- super(param1,param2);
- }
-
- public static function ADD(param1:CPosition, param2:CPosition) : CPosition
- {
- return new CPosition(param1.x + param2.x,param1.y + param2.y);
- }
-
- public static function SUBTRACT(param1:CPosition, param2:CPosition) : CPosition
- {
- return new CPosition(param1.x - param2.x,param1.y - param2.y);
- }
-
- public static function NORMALIZE(param1:CPosition, param2:Number = 1) : CPosition
- {
- param1 = param1.Clone();
- if(true)
- {
- param1.normalize(param2);
- }
- return param1;
- }
-
- public static function CLONE(param1:*) : CPosition
- {
- return new CPosition(param1.x,param1.y);
- }
-
- public static function Polar(param1:Number, param2:Number) : CPosition
- {
- var _loc3_:Point = null;
- _loc3_ = Point.polar(param1,param2);
- return new CPosition(_loc3_.x,_loc3_.y);
- }
-
- public static function DISTANCESQR(param1:CPosition, param2:CPosition) : Number
- {
- var _loc3_:* = NaN;
- var _loc4_:Number = NaN;
- §§push(param1.x - param2.x);
- if(true)
- {
- var _loc5_:*;
- §§push(_loc5_ = §§pop());
- if(true)
- {
- §§goto(addr64);
- }
- §§goto(addr52);
- }
- addr64:
- §§push(§§pop());
- if(true)
- {
- _loc3_ = §§pop();
- §§push(_loc5_);
- }
- if(true)
- {
- §§push(§§pop() * _loc3_);
- }
- §§push(param1.y - param2.y);
- §§push(param1.y - param2.y);
- if(true)
- {
- _loc5_ = §§pop();
- _loc4_ = §§pop();
- addr52:
- §§push(_loc5_);
- §§push(_loc4_);
- }
- return §§pop() + §§pop() * §§pop();
- }
-
- public function get mAngleDEG() : Number
- {
- §§push(Math.atan2(y,x) * 180);
- if(true)
- {
- §§push(§§pop() / Math.PI);
- }
- return §§pop();
- }
-
- public function AddXY(param1:Number, param2:Number) : void
- {
- x += param1;
- y += param2;
- }
-
- public function SetXY(param1:Number, param2:Number = 0) : void
- {
- x = param1;
- y = param2;
- }
-
- public function DistanceSQR(param1:CPosition) : Number
- {
- var _loc2_:Number = NaN;
- var _loc3_:Number = NaN;
- §§push(x - param1.x);
- if(true)
- {
- §§push(_loc2_ = §§pop());
- if(true)
- {
- §§push(§§pop() * _loc2_);
- }
- var _loc4_:*;
- §§push(_loc4_ = y - param1.y);
- if(true)
- {
- _loc3_ = §§pop();
- §§push(_loc4_);
- }
- §§push(§§pop() + §§pop() * _loc3_);
- }
- return §§pop();
- }
-
- public function Add(param1:CPosition) : void
- {
- x += param1.x;
- y += param1.y;
- }
-
- public function GetAngleDEG(param1:Number = 1) : Number
- {
- return Math.atan2(y * param1,x * param1) * 180 / Math.PI;
- }
-
- public function RotateZ(param1:Number) : void
- {
- var _loc2_:Number = NaN;
- var _loc3_:Number = NaN;
- var _loc4_:Number = NaN;
- var _loc5_:Number = NaN;
- _loc2_ = Math.cos(param1);
- _loc3_ = Math.sin(param1);
- _loc4_ = x * _loc2_ - y * _loc3_;
- _loc5_ = y * _loc2_ + x * _loc3_;
- x = _loc4_;
- y = _loc5_;
- }
-
- public function Copy(param1:*) : void
- {
- if(true)
- {
- x = param1.x;
- y = param1.y;
- }
- }
-
- internal function _fix(param1:Number) : Number
- {
- return Math.floor(param1 * 10000) / 10000;
- }
-
- public function GetMinAndMaxRadius(param1:Number) : Object
- {
- return {
- "min":new CPosition(x - param1,y - param1),
- "max":new CPosition(x + param1,y + param1)
- };
- }
-
- public function Distance(param1:CPosition) : Number
- {
- var _loc2_:* = NaN;
- var _loc3_:* = NaN;
- if(true)
- {
- §§push(x - param1.x);
- if(true)
- {
- §§push(§§pop());
- if(true)
- {
- _loc2_ = §§pop();
- §§push(y - param1.y);
- }
- §§push(§§pop());
- }
- _loc3_ = §§pop();
- }
- return Math.sqrt(_loc2_ * _loc2_ + _loc3_ * _loc3_);
- }
-
- public function get mAngleRAD() : Number
- {
- return Math.atan2(y,x);
- }
-
- public function Sub(param1:CPosition) : void
- {
- x -= param1.x;
- y -= param1.y;
- }
-
- public function ScaleN(param1:Number) : void
- {
- if(true)
- {
- x *= param1;
- y *= param1;
- }
- }
-
- override public function toString() : String
- {
- §§push("CPosition" + ": ");
- §§push(_fix(x));
- if(true)
- {
- §§push(§§pop() + §§pop() + ",");
- §§push(_fix(y));
- }
- return §§pop() + §§pop();
- }
-
- public function ScaleN2D(param1:Number) : void
- {
- x *= param1;
- y *= param1;
- }
-
- public function get mLength() : Number
- {
- return Math.sqrt(x * x + y * y);
- }
-
- public function Clone() : CPosition
- {
- return new CPosition(x,y);
- }
- }
- }
-